#ifndef		States__StateGame_h
#define		States__StateGame_h

#include	"IState.h"
#include	<GUI/ControlGroup.h>
#include	<GUI/Control.h>
#include	<GUI/Label.h>
#include	<Map/Map.h>
#include	<Game/ShellList.h>
#include	<Game/PlayerTank.h>
#include	<Game/ComputerTank.h>

class Config;
class SoundSystem;

const unsigned int StateGameId = 4;

enum GameState
{
	gsStoped,
	gsPlaying,
	gsIncLevel,
	gsVictory,
	gsGameOver
};

class StateGame : public IState
{
public:
	StateGame(StateMachine * machine, Config * config, SoundSystem * soundSystem);
	virtual ~StateGame();
	virtual void update(double delay);
	virtual void render() const;
	virtual void changingState(bool active);
private:
	void start();
	void upLevel();
	void stop();
//	void restart() { stop(); start(); }
	void updateLabels();
private:
	GameState m_gameState;
	double m_time;
	ControlGroup m_control;
	Label * m_life;
	Label * m_enemies;
	Label * m_nextLevel;
	Label * m_victory;
	Label * m_gameOver;
	unsigned int m_level;
	bool m_paused;
	Map m_map;
	ShellList m_shellList;
	PlayerTank m_player;
	ComputerTank m_enemy[2];
};

#endif	//	States__StateGame_h

